package com.slz3.business.module.goodsManagement.gooBaseGoodsAttributeValue.steward;

import com.slz3.business.frame.response.RR;
import com.slz3.business.frame.response.ResInfo;
import com.slz3.business.module.goodsManagement.gooBaseGoodsAttributeValue.domain.GooBaseGoodsAttributeValue;
import com.slz3.business.module.goodsManagement.gooBaseGoodsAttributeValue.domain.GooBaseGoodsAttributeValueCondition;
import org.springframework.stereotype.Controller;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

import javax.annotation.Resource;

@Controller
public class GooBaseGoodsAttributeValueResController {

    @Resource
    private GooBaseGoodsAttributeValueResAtomic gooBaseGoodsAttributeValueResAtomic;

    public Mono<ServerResponse> add(ServerRequest req, GooBaseGoodsAttributeValue gooBaseGoodsAttributeValue) {
        if (GooBaseGoodsAttributeValueResUnsafeValid.add(req, gooBaseGoodsAttributeValue)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return gooBaseGoodsAttributeValueResAtomic.add_$GooBaseGoodsAttributeValueUpdateLock(req, gooBaseGoodsAttributeValue);
        }
    }

    public Mono<ServerResponse> delete(ServerRequest req, GooBaseGoodsAttributeValueCondition gooBaseGoodsAttributeValueCondition) {
        if (GooBaseGoodsAttributeValueResUnsafeValid.delete(req, gooBaseGoodsAttributeValueCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return gooBaseGoodsAttributeValueResAtomic.delete_$GooBaseGoodsAttributeValueUpdateLock(req, gooBaseGoodsAttributeValueCondition);
        }
    }

    public Mono<ServerResponse> modify(ServerRequest req, GooBaseGoodsAttributeValue gooBaseGoodsAttributeValue) {
        if (GooBaseGoodsAttributeValueResUnsafeValid.modify(req, gooBaseGoodsAttributeValue)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return gooBaseGoodsAttributeValueResAtomic.modify_$GooBaseGoodsAttributeValueUpdateLock(req, gooBaseGoodsAttributeValue);
        }
    }

    public Mono<ServerResponse> list(ServerRequest req) {
        if (GooBaseGoodsAttributeValueResUnsafeValid.list(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return GooBaseGoodsAttributeValueResExecutor.list(req);
        }
    }

    public Mono<ServerResponse> info(ServerRequest req) {
//        return gooBaseGoodsAttributeValueResAtomic.info_$GooBaseGoodsAttributeValueUpdateLock(req);
        if (GooBaseGoodsAttributeValueResUnsafeValid.info(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return gooBaseGoodsAttributeValueResAtomic.info_$GooBaseGoodsAttributeValueUpdateLock(req);
        }
    }

    public Mono<ServerResponse> choice(ServerRequest req) {
        if (GooBaseGoodsAttributeValueResUnsafeValid.choice(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return GooBaseGoodsAttributeValueResExecutor.choice(req);
        }
    }

    public Mono<ServerResponse> auditSubmit(ServerRequest req, GooBaseGoodsAttributeValueCondition gooBaseGoodsAttributeValueCondition) {
        //
        if (GooBaseGoodsAttributeValueResUnsafeValid.auditSubmit(req, gooBaseGoodsAttributeValueCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return gooBaseGoodsAttributeValueResAtomic.auditSubmit_$GooBaseGoodsAttributeValueUpdateLock(req, gooBaseGoodsAttributeValueCondition);
        }
    }

    public Mono<ServerResponse> audit(ServerRequest req, GooBaseGoodsAttributeValueCondition gooBaseGoodsAttributeValueCondition) {
        if (GooBaseGoodsAttributeValueResUnsafeValid.audit(req, gooBaseGoodsAttributeValueCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return gooBaseGoodsAttributeValueResAtomic.audit_$GooBaseGoodsAttributeValueUpdateLock(req, gooBaseGoodsAttributeValueCondition);
        }
    }

    public Mono<ServerResponse> auditReject(ServerRequest req, GooBaseGoodsAttributeValueCondition gooBaseGoodsAttributeValueCondition) {
        if (GooBaseGoodsAttributeValueResUnsafeValid.auditReject(req, gooBaseGoodsAttributeValueCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return gooBaseGoodsAttributeValueResAtomic.auditReject_$GooBaseGoodsAttributeValueUpdateLock(req, gooBaseGoodsAttributeValueCondition);
        }
    }

    public Mono<ServerResponse> usingEnable(ServerRequest req, GooBaseGoodsAttributeValueCondition gooBaseGoodsAttributeValueCondition) {
        if (GooBaseGoodsAttributeValueResUnsafeValid.usingEnable(req, gooBaseGoodsAttributeValueCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return gooBaseGoodsAttributeValueResAtomic.usingEnable_$GooBaseGoodsAttributeValueUpdateLock(req, gooBaseGoodsAttributeValueCondition);
        }
    }

    public Mono<ServerResponse> usingDisable(ServerRequest req, GooBaseGoodsAttributeValueCondition gooBaseGoodsAttributeValueCondition) {
        if (GooBaseGoodsAttributeValueResUnsafeValid.usingDisable(req, gooBaseGoodsAttributeValueCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return gooBaseGoodsAttributeValueResAtomic.usingDisable_$GooBaseGoodsAttributeValueUpdateLock(req, gooBaseGoodsAttributeValueCondition);
        }
    }

}
